package com.example.mvc;

import java.util.Scanner;

public class Demo1Controller {
    public String login() {

        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎输入XXX系统");
        System.out.println("请输入用户名：");
        String username = sc.next();
        System.out.println("请输入密码:");
        String password = sc.next();

        Demo3Dao demo3Dao = new Demo3Dao();
        String message = demo3Dao.login(username, password);

        return message;

    }

    public String register( ){
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎输入XXX系统");
        System.out.println("请输入用户名：");
        String username = sc.next();
        System.out.println("请输入密码:");
        String password = sc.next();
        System.out.println("请再次输入密码:");
        String newPassword = sc.next();

        Demo3Dao demo3Dao = new Demo3Dao();


        try {
            return demo3Dao.register(username, password, newPassword);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
